<?php
class Admin_Form_ValidateAddColor extends Zendvn_Validate_Form{

	public function __construct($arrParam = null, $options = null){
		
		//================================Validate Color================================
		foreach ($arrParam['size_id'] as $k => $v){
			$validator = new Zend_Validate();
			$validator->addValidator(new Zend_Validate_NotEmpty(), true);
			if(!$validator->isValid($arrParam['color'][$v])){
				$message = $validator->getMessages();
				$this->_arrError['color'][$v] = current($message);
			}
		}
		
		/*=======================================================
		 * Start - return correct data array
		 *=======================================================*/
		$this->_arrData = $arrParam;
	}
	
	public function getData(){
		return $this->_arrData;
	}
	//return true|false
	public function isVaild(){
		$flag = false;
		if(count($this->_arrError) > 0 && $this->_arrError != ''){
			$flag = true;
		}
		return $flag;
	}
	
	public function getMessageErrors(){
		return $this->_arrError;
	}
	
}







